package com.sxkiler.demo.seata.controller;

import com.sxkiler.demo.seata.dto.BusinessDTO;
import com.sxkiler.demo.seata.service.saga.SAGABusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/business/saga")
public class SAGABusinessController {

    @Autowired
    SAGABusinessService businessService;

    @RequestMapping("/buy")
    public String handlerBusiness(@RequestBody BusinessDTO businessDTO) {
        return businessService.handlerBusiness(businessDTO);
    }
}
